<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>jQuery File Upload Example</title>
<style>
  .bar { height: 18px;  background: green; }
</style>
</head>
<body>
<input id="fileupload" type="file" name="files[]" data-url="php/" multiple>
<button id="btnUpload">上传</button>
<script src="../js/jquery-3.2.1.js"></script>
<script src="../js/jquery.ui.widget.js"></script>
<script src="../js/jquery.iframe-transport.js"></script>
<script src="../js/jquery.fileupload.js"></script>
<script>
    $("#fileupload").fileupload({
        add(e,data){//当将文件添加到file框中时触发
            $("#btnUpload").click(()=>{
                data.submit();
            })
        },
        done(e,data){
            //当文件上传成功后触发
            $("#btnUpload").off("click");
            alert("上传完毕");
        }
    })
</script>
</body> 
</html>